# cmake最小版本
cmake_minimum_required(VERSION 3.5)

# 项目名字和版本
project(yolo_linux VERSION 1.0)

# 设置C++语言版本
set(CMAKE_CXX_STANDARD 17)

add_definitions(-DLINUX=TRUE)

find_package(OpenCV 4 REQUIRED)

if(OpenCV_FOUND)
    message(STATUS "OpenCV library status:")
    message(STATUS "    version: ${OpenCV_VERSION}")
    message(STATUS "    libraries: ${OpenCV_LIBS}")
    message(STATUS "    include path: ${OpenCV_INCLUDE_DIRS}")
else()
    message(FATAL_ERROR "Could not find OpenCV")
endif()

# target_include_directories(cam_server PRIVATE ${OpenCV_INCLUDE_DIRS})

# 设置可执行文件输出目录（全局生效）
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

#库头文件路径
include_directories(${CMAKE_SOURCE_DIR}/module/websocketpp
                    ${CMAKE_SOURCE_DIR}/module/onnx/include)

# 库文件路径 
link_directories(${CMAKE_SOURCE_DIR}/module/websocketpp
                 ${CMAKE_SOURCE_DIR}/module/onnx/lib)

# 添加子目录（顺序：底层库 -> 上层模块 -> 应用层）
add_subdirectory(driver/driver1)
add_subdirectory(driver/driver2)
add_subdirectory(driver/camera)

add_subdirectory(module/module1)
add_subdirectory(module/module2)
add_subdirectory(${CMAKE_SOURCE_DIR}/module/websocketpp)
add_subdirectory(module/base64)
add_subdirectory(module/cJSON)
add_subdirectory(module/sorfttimer)
add_subdirectory(module/miniz)
add_subdirectory(module/YOLOv8-ONNXRuntime-CPP)

add_subdirectory(tool/tool1)
add_subdirectory(tool/tool2)
add_subdirectory(project/app)
add_subdirectory(project/main)
